<?php
	include("../config.php");
	
  $time = microtime();
  $time = explode(' ', $time);
  $time = $time[1] + $time[0];
  $start = $time;
	
	require_once('../lang/'.$default_language.'.php');
	include("../inc/class.database.php");
	include("../inc/db_connect.php");
	include("../inc/common.php");
	
if ( file_exists('../themes/'.$DefaultStyle.'/functions.php') )
include('../themes/'.$DefaultStyle.'/functions.php');
	
	include("admin_sys.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

 	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta http-equiv="content-style-type" content="text/css" />
	<meta name="author" content="Ivan Antonijevic" />
	<meta name="rating" content="Safe For Kids" />
 	<meta name="description" content="<?=$HomeDesc?>" />
	<meta name="keywords" content="<?=$HomeKeywords?>" />
	<title><?=$HomeTitle?></title>
	<link rel="stylesheet" href="<?=$website?>themes/<?=$DefaultStyle?>/style.css" type="text/css" />
	<link rel="stylesheet" href="<?=$website?>adm/style.css" type="text/css" />
    <script type="text/javascript" src="<?=$website?>scripts.js"></script>
<?php if (is_logged() AND isset($_SESSION["level"] ) AND $_SESSION["level"]>=7 ) { ?>
    <script type="text/javascript" src="<?php echo $website;?>adm/ckeditor/ckeditor.js"></script>
<?php } ?>
</head>
  
<body>

<?php if (is_logged() AND isset($_SESSION["level"] ) AND $_SESSION["level"]>=7 ) { ?>
<div id="wrapper">
<div id="logo">
  <h1>ADMINISTRATION</h1>
</div>  

<div class="mainmenu">
<ul class="dd_menu">
<?php if (is_logged() AND isset($_SESSION["level"] ) AND $_SESSION["level"]>=9 ) { ?>
  <li><a class="menuButtons" href="<?=$website?>adm/">Dashboard</a>
    <ul>
	  <li><a href="<?=$website?>adm/?cfg">Configuration</a> </li>
	  <li><a href="<?=$website?>adm/?optimize_tables">Optimize Tables</a></li>
	</ul>
  </li>
  <li><a class="menuButtons" href="<?=$website?>adm/?users">Users</a></li>
  <li><a class="menuButtons" href="<?=$website?>adm/?staff">Staff</a></li>
  <li><a class="menuButtons" href="<?=$website?>adm/?torneos">Torneos</a></li>
  
  <li><a class="menuButtons" href="<?=$website?>adm/?bot">BOT</a></li>
   <?php } //Admin finish?>
 <?php if (is_logged() AND isset($_SESSION["level"] ) AND $_SESSION["level"]>=8 ) { ?>
   <li>
  <a class="menuButtons" href="<?=$website?>adm/?bans">Bans</a>
  </li>
 <?php } //Fiscal finish ?>
  <li><a class="menuButtons" href="<?=$website?>adm/?name">Buscar por Nick</a></li>
  <li><a class="menuButtons" href="<?=$website?>adm/?ip">Buscar por IP</a></li>
  <li><a class="menuButtons" href="<?=$website?>adm/?email">Buscar por Email</a></li>
  <li><a class="menuButtons" href="<?=$website?>adm/?posts">Posts</a></li>
  
  
  <li><a class="menuButtons" href="<?=$website?>adm/?logout"><?=$_SESSION["username"]?></a>
    <ul>
	  <li><a href="<?=$website?>adm/?users&amp;edit=<?=$_SESSION["user_id"]?>">Edit Account</a></li>
	  <li><a href="<?=$website?>">Go to OS&raquo; </a></li>
	  <li><a href="<?=$website?>adm/?logout">(logout)</a></li>
	</ul>
  </li>
</ul> 


</div>


<?php
include('admin_pages.php');
include('../themes/'.$DefaultStyle.'/footer.php');
?>
</div>
<?php } else { 
  include("login.php");
} ?>